home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Burning & Media
/
GB-PVR 1.2.13
/
GBPVR10213.msi
/
Cabs.w1.cab
/
search_results.js507
< prev
next >
Wrap
Text File
|
2007-10-06
|
1KB
|
43 lines
var illegalChars = /[\D_]/; // allow only digits 0-9
function checkNumericOnly(field) {
var strPass = field.value;
var strLength = strPass.length - 1;
var lchar = strPass.charAt(strLength);
if (illegalChars.test(lchar)) {
field.value = strPass.substring(0, strLength);
}
}
function StartUp() {
var x = document.getElementsByTagName('input');
for (var i=0;i<x.length;i++)
{
if (x[i].type == 'text') {
addEvent(x[i],"focus",SelectAll);
}
}
}
function SelectAll() {
this.select();
}
function addEvent( obj, type, fn ) {
if ( obj.attachEvent ) {
obj["e"+type+fn] = fn;
obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
obj.attachEvent( "on"+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
function removeEvent( obj, type, fn ) {
if ( obj.detachEvent ) {
obj.detachEvent( "on"+type, obj[type+fn] );
obj[type+fn] = null;
} else
obj.removeEventListener( type, fn, false );
}